const install = (Vue, vm) => {
	Vue.prototype.$api = {
		//登录
		login:(params = "",data={},header = {}) => vm.$http.post(`/auth/oauth/token?${params}`, data,header),
		//微信绑定
		bindwechat:(code = '',header = {}) => vm.$http.post("/admin/social/bindzz?state=APP_WECHAT&code=" + code,{},header),
		//微信登录
		loginByWechat:(code = '',header = {}) => vm.$http.get("/admin/social/login/APP_WECHAT@" + code, {},header),
		//退出
		loginout:(params = {},header = {}) => vm.$http.delete("/auth/token/logout", params,header),
		//权限-菜单列表
		getAuth:(projectId,header = {}) => vm.$http.get(`/admin/menu/smartBuild/tree/${projectId}`,{},header),
		
		//获取项目列表
		getProjects:(params = {},header = {}) => vm.$http.get("/admin/user/get-projects", params,header),
		
		//获取水泥标号
		getCementType:(params = {},header = {}) => vm.$http.get("/act/cement-type/list", params,header),
		//获取浇筑部位
		getPositionList:(params = {},header = {}) => vm.$http.get("/act/pour-part/list", params,header),
		//获取供应商列表
		getSupplierList:(params = {},header = {}) => vm.$http.get("/act/supplier/list", params,header),
		
		//获取订单列表
		orderList:(params = {},header = {}) => vm.$http.post("/act/order/list_page", params,header),
		//获取订单详情
		orderDetail:(id = null,params = {},header = {}) => vm.$http.get(`/act/order/details/${id}`, params,header),
		//发货-所需混凝土规格列表
		orderCement:(id = null,params = {},header = {}) => vm.$http.get(`/act/order/cement_order/list/${id}`, params,header),
		//发货-新增任务
		AddOrderTask:(params = {},header = {}) => vm.$http.post(`/act/order/task/add`, params,header),
		//发货-批量新增
		AddOrderBatchTask:(params = {},header = {}) => vm.$http.post(`/act/order/task/batch_add`, params,header),
		//发货-任务列表
		taskList:(params = {},header = {}) => vm.$http.post(`/act/order/task/list`, params,header),
		//发货-订单确认
		orderConfirm:(params = {},header = {}) => vm.$http.post(`/act/order/receipt`, params,header),
		
		//分页获取待确认订单
		procurementOrderPageList:(params = {}, header = {}) => vm.$http.post(`/act/procurement_order/page_list`, params, header),
		//获取订单信息
		procurementOrderList:(params = {}, header = {}) => vm.$http.post(`/act/procurement_order/list`, params, header),
		//订单确认
		confirmOrder:(params = {}, header = {}) => vm.$http.post(`/act/procurement_order/ensure`, params, header),

		//发货-删除任务
		delOrderTask:(id = null,params = {},header = {}) => vm.$http.delete(`/act/order/task/${id}`, params,header),
		//发货-修改任务
		editOrderTask:(params = {},header = {}) => vm.$http.put(`/act/order/task/update`, params,header),

		//车辆管理
		addTruck:(params = {},header = {}) => vm.$http.post("/act/truck_supplier/add", params,header),
		truckList:(params = {},header = {}) => vm.$http.post("/act/truck_supplier/list_page", params,header),
		editTruck:(id = null,params = {},header = {}) => vm.$http.post(`/act/truck_supplier/editInfo/${id}`, params,header),
		delTruck:(id = null,params = {},header = {}) => vm.$http.delete(`/act/truck_supplier/${id}`, params,header),

		//司机管理
		addDriver:(params = {},header = {}) => vm.$http.post("/act/driver_supplier/add", params,header),
		driverList:(params = {},header = {}) => vm.$http.post("/act/driver_supplier/list_page", params,header),
		editDriver:(id = null,params = {},header = {}) => vm.$http.put(`/act/driver_supplier/edit/${id}`, params,header),
		delDriver:(id = null,params = {},header = {}) => vm.$http.delete(`/act/driver_supplier/${id}`, params,header),
	};
}

export default {
	install
}